<?php
// +-------------------------------------------------------------------
// |
// +-------------------------------------------------------------------
// | Copyright (c) 2009-2016 All rights reserved.
// +-------------------------------------------------------------------
namespace Service\Api\V1;

class UserMsgReadSub
{
    public $login = true; //是否需要登录才能访问该接口
    public $title = "用户消息更改成已读状态ok";
    public $group = '用户';
    public $desc = "";

    public $input = [
    ];

    public $output = [
    ];

    public function run($param, $uid)
    {
        $result = M('user_msg')->where(['uid' => $uid])
            ->save(['is_read' => 1]);

        if($result){
            return true;
        }else{
           throw new \Exception('更改失败');
        }

    }
}
